package com.disc.util;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by Tonight on 2017/7/18.
 */
public class RegexUtil {

    public static List<String> findAll(String content,String regex,int group)
    {
        Pattern pattern = Pattern.compile(regex);
        Matcher matcher = pattern.matcher(content);
        List<String> resultList = new ArrayList<>();
        while(matcher.find())
        {
            resultList.add(matcher.group(group));
        }
        return resultList;
    }
}
